namespace Sharpmark.PerfectLife.Core.HtmlDocument
{

    public class LinkGenerator : HtmlGenerator
    {
        public LinkGenerator() : base("a") { }

        public void GenerateLinkHtml(
            string href, string title, string rel,
            bool isOpenNewWindows, string content)
        {
            NewAttribute("href", href);
            if (title != null && title != "")
            {
                NewAttribute("title", title);
            }
            if (rel != null && rel != "")
            {
                NewAttribute("rel", rel);
            }
            if (isOpenNewWindows)
            {
                NewAttribute("target", "_blank");
            }

            AppendContent(content);

            CloseElement();
        }
    }
}
